package com.thread.TimeDown;


public class TestTime {
    public static void main(String[] args) {//2、调用TenDown();
        try {
            TenDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    //模拟倒计时
    public static void TenDown() throws InterruptedException {//1、定义方法，在外抛出异常
        int num =10;
        while (true){
            Thread.sleep(1000);
            System.out.println(num--);
            if(num<0){
                break;
            }
        }
    }
}
